﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using NLite.Security;

namespace NLite.Web.Security
{
    ///// <summary>
    ///// 授权过滤器模块
    ///// </summary>
    //class AuthorizeModule : IHttpModule
    //{
    //    IPermissionService service ;
    //    public void Dispose()
    //    {
    //    }

    //    public void Init(HttpApplication context)
    //    {
    //        service = ServiceLocator.Get<IPermissionService>();
    //        if(service != null)
    //            context.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute);
    //    }

    //    void context_PreRequestHandlerExecute(object sender, EventArgs e)
    //    {
    //        if (HttpContext.Current.User.Identity.IsAuthenticated)
    //        {
    //            if (!service.HasPermission(HttpContext.Current.User, HttpRequestContext.Current.ValueProvider))
    //                throw new AuthorizationException(string.Format("The visit of {0} has been rejected.", HttpContext.Current.Request.Url));
    //        }
    //    }
      
    //}

 
}
